import request from '@/utils/request'


export function fetchKnowledgeTypeList(query) {
  return request({
    url: '/knowledgetype/list',
    method: 'post',
    data: query
  })
}


export function fetchKnowledgeTypeChildren(query) {
  return request({
    url: '/knowledgetype/getchildren',
    method: 'post',
    data: query
  })
}


export function updateKnowledgeType(query) {
  return request({
    url: '/knowledgetype/updateKnowledgeType',
    method: 'post',
    data: query
  })
}


export function delKnowledgeType(query) {
  return request({
    url: '/knowledgetype/deleteKnowledgeType',
    method: 'post',
    data: query
  })
}


export function addKnowledgeType(query) {
  return request({
    url: '/knowledgetype/addKnowledgeType',
    method: 'post',
    data: query
  })
}


export function fileUpload(fileobj) {
  const param = new FormData()
  param.append('file', fileobj.file)
  return request({
    method: 'post',
    url: '/knowledgetype/uploadFile',
    headers: { 'Content-Type': 'multipart/form-data' },
    data: param
  })
}



export function fetchKnowledgeList(query) {
  return request({
    url: '/knowledge/list',
    method: 'post',
    data: query
  })
}


export function updateKnowledgeStatus(query) {
  return request({
    url: '/knowledge/updateKnowledgeStatus',
    method: 'post',
    data: query
  })
}


export function addKnowledge(query) {
  return request({
    url: '/knowledge/add',
    method: 'post',
    data: query
  })
}


export function modifyKnowledge(query) {
  return request({
    url: '/knowledge/modify',
    method: 'post',
    data: query
  })
}
